package iammry.com.activity;

import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.lidroid.xutils.view.annotation.ViewInject;

import iammry.com.R;
import iammry.com.base.BaseActivity;

public class OpenBlueActivity extends BaseActivity
{

	@ViewInject(R.id.bt_openblue)
	private Button bt_openblue;
	
	@Override
	protected void initView()
	{
		//设置布局
		setLayout(this, R.layout.openblueactivity_layout);

	}
	@Override
	protected void initData() 
	{
		
	}
	
	@Override
	protected void initEvent() 
	{
		bt_openblue.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0)
			{

				BluetoothAdapter mBlueAdapter = BluetoothAdapter.getDefaultAdapter();
				if (!mBlueAdapter.isEnabled())
				{
					Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
					// 请求开启蓝牙设备
					startActivity(intent);
				}

				startActivity(PersonInfoActivity.class);

				finish();
				
			}
		});
	}

}
